package com.arpa.wms.domain.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * 盘点单 实体
 * @author jinss
 * @date 2020-08-28 10:14:11
 **/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="Counting对象", description="盘点单")
@TableName("wms_counting")
public class Counting extends BasicEntity {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "盘点单号")
    @TableField("code")
    private String code;

    @ApiModelProperty(value = "仓库")
    @TableField("warehouse_code")
    private String warehouseCode;

    @ApiModelProperty(value = "入驻商")
    @TableField("shipment_code")
    private String shipmentCode;

    @ApiModelProperty(value = "所属机构")
    @TableField("group_code")
    private String groupCode;

    @ApiModelProperty(value = "库位")
    @TableField("location")
    private String location;

    @ApiModelProperty(value = "动碰次数")
    @TableField("op_quantity")
    private Long opQuantity;

    @ApiModelProperty(value = "监盘人")
    @TableField("supervisor")
    @NotBlank(message = "监盘人不能为空！")
    @Length(max = 100, message = "监盘人长度不能大于100个字符", groups = {Save.class, Update.class})
    private String supervisor;

    @ApiModelProperty(value = "状态")
    @TableField("status")
    private String status;

    @ApiModelProperty(value = "单据类型")
    @TableField("type")
    private String type;

    @ApiModelProperty(value = "备注")
    @TableField("remarks")
    @Length(max = 100, message = "备注长度不能大于100个字符", groups = {Save.class, Update.class})
    private String remarks;

    @ApiModelProperty(value = "审核人code")
    @TableField("audit_code")
    private String auditCode;

    @ApiModelProperty(value = "审核人name")
    @TableField("audit_name")
    private String auditName;

    @ApiModelProperty(value = "备注")
    @TableField("audit_mind")
    private String auditMind;

    @ApiModelProperty(value = "下发状态:0未下发，1已下发；")
    @TableField("is_issue")
    private Integer issue;

    @ApiModelProperty(value = "仓库名称")
    @TableField("warehouse_name")
    private String warehouseName;

    @ApiModelProperty(value = "盘点单明细")
    @TableField(exist = false)
    private ValidList<CountingItem> countingItemList = new ValidList<>();

    @Valid
    @ApiModelProperty(value = "盘点单登记明细")
    @TableField(exist = false)
    private ValidList<CountingRegister> countingRegisterList = new ValidList<>();

    @ApiModelProperty(value = "PC盘点单登记要删除明细CODE，PC盘点用")
    @TableField(exist = false)
    private List<String> deleteCodes;

    public interface Save{}
    public interface Update{}
}
